package es.us.isa.jdbl.domain;



import java.util.List;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SecondaryTable;
import javax.persistence.SecondaryTables;
import javax.persistence.Table;


@Entity
@SecondaryTables({
	@SecondaryTable(name="content_field_acronym", catalog = "webisa", pkJoinColumns={
			@PrimaryKeyJoinColumn(name="nid", referencedColumnName="nid")}),
	@SecondaryTable(name="content_type_workshop_conference", catalog = "webisa", pkJoinColumns={
			@PrimaryKeyJoinColumn(name="nid", referencedColumnName="nid")}),
	@SecondaryTable(name="content_field_startdate", catalog = "webisa", pkJoinColumns={
			@PrimaryKeyJoinColumn(name="nid", referencedColumnName="nid")}),
	@SecondaryTable(name="content_field_url", catalog = "webisa", pkJoinColumns={
			@PrimaryKeyJoinColumn(name="nid", referencedColumnName="nid")}),
	@SecondaryTable(name="content_field_project", catalog = "webisa", pkJoinColumns={
			@PrimaryKeyJoinColumn(name="nid", referencedColumnName="nid")}),			
})

@DiscriminatorValue("workshop_conference")
public class Committee extends AbstractNode{

	@Column(name="field_acronym_value", table="content_field_acronym")
	private String acronym;//content_field_acronym

	@Column(name="field_category_committee_value", table="content_type_workshop_conference")
	private String category;//content_type_workshop_conference

	@Column(name="field_placeofcelebration_value", table="content_type_workshop_conference")
	private String placeOfCelebration;//content_type_workshop_conference

	@Column(name="field_startdate_value", table="content_field_startdate")
	private String startDate;//content_field_stardate

	@Column(name="field_url_url",table="content_field_url")
	private String url;//content_field_url

	@ManyToMany
	@JoinTable(name="content_field_projects", catalog = "webisa",
			joinColumns=@JoinColumn(name="nid"),
			inverseJoinColumns=@JoinColumn(name="field_projects_nid"))
	private List<Project> projects;//content_field_project 
	
	//private Map<Member, String> members;//content_field_user && content_field_roluser

	public String getAcronym() {
		return acronym;
	}

	public void setAcronym(String acronym) {
		this.acronym = acronym;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getPlaceOfCelebration() {
		return placeOfCelebration;
	}

	public void setPlaceOfCelebration(String placeOfCelebration) {
		this.placeOfCelebration = placeOfCelebration;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<Project> getProjects() {
		return projects;
	}

	public void setProjects(List<Project> projects) {
		this.projects = projects;
	}
	
	
	
	
}
